<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>本地存储</title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">   
<link rel="stylesheet" href="../../../../assets/css/reset.css"/>

    <link rel="stylesheet" href="../../../../assets/css/examples.css"/>

</head>
<body>
<h1>
    本地存储（Data）
</h1>

<ul>
    <li>
        <a href="javascript:void(0)" id="setData">设置数据（setData）</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="getData">获取数据（getData）</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="removeData">移除数据（removeData</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="clearData">清空数据（clearData）</a>
    </li>
</ul>

<div style="height: 1000px;display: none;" id="scrollEl"></div>
<script  src="../../../../../core/$$.js"></script>
<script  src="../../../../../core/libs/zepto/zepto.min.js"></script>
<script  src="../../../../../core/libs/zepto/selector.js"></script>
<script  src="../../../../../core/libs/zepto/touch.js"></script>
<script  src="../../../../../core/libs/underscore-min.js"></script>
<script  src="../../../../../core/libs/oop.js"></script>
<script  src="../../../../../core/extend/prototype.js"></script>
<script  src="../../../../../core/extend/function.js"></script>
<script  src="../../../../../core/native/platformAdapter.js"></script>
<script  src="../../../../../core/native/api.js"></script>
<script  src="../../../../../core/native/eventListener.js"></script>
<script  src="../../../classes/XX.js"></script>
<script  src="../../../classes/common.js"></script>
<script  src="../../../../config/url/dev.js"></script>

<script type="text/javascript">
    $('#setData').on('tap', function () {
        $$.Native.setData({
            name: 'Pragma',
            value: 'no-cache',
            callback: function () {
                $$.Native.alert({text:'数据写入完毕'});
            }
        });
    });

    $('#getData').on('tap', function () {
        $$.Native.getData({
            name: 'Pragma',
            callback: function (value) {
                $$.Native.alert({text:'读取数据 ' + value});
            }
        });
    });

    $('#removeData').on('tap', function () {
        $$.Native.removeData({
            name: 'Pragma',
            callback: function () {
                $$.Native.alert({text:'数据删除完毕'});
            }
        });
    });

    $('#clearData').on('tap', function () {
        $$.Native.removeData({
            callback: function () {
                $$.Native.alert({text:'数据清空完毕'});
            }
        });
    });

</script>
</body>
</html>